﻿using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.Linq;
using System.Threading.Tasks;
using Microsoft.AspNetCore.Mvc;
using Finbook.Mvc.Models;
using Finbook.Mvc.Infrastructure;
using Refit;
using Finbook.Mvc.Services;

namespace Finbook.Mvc.Controllers
{
    public class HomeController : Controller
    {
        private readonly IValueService _valueService;
        public HomeController(IValueService valueService)
        {
            _valueService = valueService;
        }
        public async Task<IActionResult> Index()
        {

            return View();
        }
        [HttpPost]
        public IActionResult Login(string name, string pwd)
        {
            return Ok();
        }
        public IActionResult About()
        {
            ViewData["Message"] = "Your application description page.";

            return View();
        }

        public IActionResult Contact()
        {
            ViewData["Message"] = "Your contact page.";

            return View();
        }

        public IActionResult Privacy()
        {
            return View();
        }

        public IActionResult GetValue(string val)
        {
            return Json(val);
        }
        [ResponseCache(Duration = 0, Location = ResponseCacheLocation.None, NoStore = true)]
        public IActionResult Error()
        {
            return View(new ErrorViewModel { RequestId = Activity.Current?.Id ?? HttpContext.TraceIdentifier });
        }

        public IActionResult GetPager(int pageIndex = 1, int pageSize = 10)
        {
            return Json(Pager.GetPager(300));
        }
    }
}
